<template>
    <div>
        <h1>对象和类型判断工具</h1>
        <h3>类型判断方法列表</h3>
        <div>isArray、isMap、isSet、isDate、isFunction、isString、isSymbol、isObject、isPromise</div>
        <h3>getObject-深度遍历对象中的每一个key和value</h3>
        <dCode :code="conf.str" />
        <h3>deepMerge-深度合并对象，老字段覆盖值或保留，新字段新增</h3>
        <dCode :code="conf.str1" />
    </div>
</template>
<script setup lang="ts">
import { reactive } from 'vue'

const conf = reactive({
    str: `ObjectUtil.getObject({a:{b:1},c:{d:2,e:3}},(key,val)=>{
    console.log(key,val);
})`,
    str1: `let a = {a:1,b:{n:2,c:2},c:{r:1,n:1}}
let newa = {a:2,b:{c:3}}
const c = ObjectUtil.deepMerge(newa,a)
`
})
</script>
<style lang="less" scoped></style>
